home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / cool / ge_cool.lha / GE_COOL2.1 / man / oldman3 / D_Node.3T < prev    next >
Text File  |  1992-06-26  |  6KB  |  213 lines

  1. .TH D_NODE
  2. .SH NAME
  3. D_Node<Type,nchild>\f1  Parameterized, dynamic-size n-ary node class
  4. .SH SYNOPSIS
  5. #include <cool/D_Node.h>
  6. .SH DESCRIPTION
  7. The \f3D_Node<Type,nchild>\f1 class implements parameterized nodes of a dynamic size 
  8. for n-ary trees. This node class is parameterized for the type and some initial 
  9. number of subtrees that each node may have. The \f3D_Node<Type,nchild> \f1class is 
  10. dynamic in the sense that the number of subtrees allowed for each node is not 
  11. fixed. \f3D_Node<Type,nchild>\f1 uses the \f3Vector<Type>\f1 class, which supports run-time 
  12. growth characteristics. As a result, the \f3D_Node<Type,nchild>\f1 class should be 
  13. used as the node type for the \f3N_Tree<Node,Type,nchild>\f1 class when the number of 
  14. subtrees is variable, unknown at compile time, or needs to increase on a 
  15. per-node basis at run-time. This capability is suited for hierarchical trees 
  16. such as may be used in an organization chart. Also, specialization of the 
  17. \f3N_Tree<Node,Type,nchild>\f1 class would allow for relatively easy implementation 
  18. of a DAG class.
  19. .SH Base Classes
  20. None
  21. .SH Friend Classes
  22. \f3N_Tree<Node,Type,nchild>
  23. .SH Public Constructors
  24. .TP
  25. \f3D_Node<Type,nchild> \f3();\f1
  26. Allocates a D-node and a vector of subtree pointers of the initial size, all of 
  27. which are set to 
  28.  
  29.  NULL .
  30. .TP
  31. \f3D_Node<Type,nchild> \f3(const Type& value\f3);\f1
  32. Allocates a D-node and a vector of subtree pointers of the initial size, all of 
  33. which are set to 
  34.  
  35.  NULL , 
  36. and initializes the value of the node to 
  37.  value .
  38. .TP
  39. \f3D_Node<Type,nchild> (const D_Node<Type,nchild>& dn\f3);\f1
  40. Duplicates the value of another D-node object 
  41.  dn .
  42. .SH Member Functions
  43. .TP
  44.  inline Type& get () const;
  45. Returns a reference to the value of the data member.
  46. .TP
  47. \f3Boolean insert_after (D_Node<Type,nchild>& dn\f3, int \f2index\f3);\f1
  48. Inserts a subtree pointer to 
  49.  dn 
  50. after the zero-relative
  51.  index . 
  52. This function 
  53. returns 
  54.  
  55.  TRUE 
  56. if successful; otherwise, this function returns 
  57.  
  58.  FALSE . 
  59. If  
  60.  index 
  61. is negative or out of range, an 
  62.  \f3\f3Error\f1\f1
  63. exception is raised.
  64. .TP
  65. \f3Boolean insert_before (D_Node<Type,nchild>& dn\f3, int \f2index);\f1
  66. Inserts a subtree pointer to 
  67.  dn 
  68. before the zero-relative 
  69.  index . 
  70. This function 
  71. returns 
  72.  
  73.  TRUE 
  74. if successful; otherwise, this function returns 
  75.  
  76.  FALSE . 
  77. If 
  78.  index 
  79. is 
  80. negative or out of range, an 
  81.  \f3\f3Error\f1\f1 
  82. exception is raised.
  83. .TP
  84.  Boolean is_leaf () const;
  85. Determines if the node is a terminal node by evaluating the subtree pointers. 
  86. If all pointers are 
  87.  
  88.  NULL , 
  89. this function returns 
  90.  
  91.  TRUE ; 
  92. otherwise, this function 
  93. returns 
  94.  
  95.  FALSE .
  96. .TP
  97.  inline int num_subtrees () const;
  98. Returns the number of subtrees for a node.
  99. .TP
  100. \f3D_Node<Type,nchild>& \f3operator= (D_Node<Type,nchild>& dn\f3);\f1
  101. Overloads the assignment operator for the class to assign the values of the 
  102. subtree pointers and the value in 
  103.  dn 
  104. to the node object. This function returns 
  105. a reference to the updated node.
  106. .TP
  107. \f3inline Boolean operator== (const Type& value\f3) const;\f1
  108. Overloads the equality operator for the \f3D_Node<Type>\f1 class. This function 
  109. returns 
  110.  
  111.  TRUE 
  112. if 
  113.  value 
  114. is equal to the value of the node object; otherwise, this 
  115. function returns 
  116.  
  117.  FALSE .
  118. .TP
  119. \f3inline Boolean operator!= (const Type& value\f3) const;\f1
  120. Overloads the inequality operator for the \f3D_Node<Type>\f1 class. This function 
  121. returns 
  122.  
  123.  TRUE
  124. if 
  125.  value 
  126. is not equal to the value of the node object; otherwise, 
  127. this function returns 
  128.  
  129.  FALSE .
  130. .TP
  131. \f3inline Boolean operator< (const Type& value\f3) const;\f1
  132. Overloads the less-than operator for the \f3D_Node<Type>\f1 class. This function 
  133. returns 
  134.  
  135.  TRUE 
  136. if 
  137.  value 
  138. is less than the value of the node object; otherwise, 
  139. this function returns 
  140.  
  141.  FALSE .
  142. .TP
  143. \f3inline Boolean operator<= (const Type& value\f3) const;\f1
  144. Overloads the less-than-or-equal operator for the \f3D_Node<Type>\f1 class. This 
  145. function returns 
  146.  
  147.  TRUE 
  148. if 
  149.  value 
  150. is less than or equal to the value of the node 
  151. object; otherwise, this function returns 
  152.  
  153.  FALSE .
  154. .TP
  155. \f3inline Boolean operator> (const Type& value\f3) const;\f1
  156. Overloads the greater-than operator for the \f3D_Node<Type>\f1 class. This function 
  157. returns 
  158.  
  159.  TRUE
  160. if 
  161.  value 
  162. is greater than the value of the node object; otherwise, 
  163. this function returns 
  164.  
  165.  FALSE .
  166. .TP
  167. \f3inline Boolean operator>= (const Type& value\f3) const;\f1
  168. Overloads the greater-than-or-equal operator for the \f3D_Node<Type>\f1 class. This 
  169. function returns 
  170.  
  171.  TRUE 
  172. if 
  173.  value 
  174. is greater than or equal to the value of the 
  175. node object; otherwise, this function returns 
  176.  
  177.  FALSE .
  178. .TP
  179. \f3inline D_Node<Type,nchild>*& \f3operator[\^] (int \f2index\f3);\f1 
  180. Returns a reference to a pointer to the subtree at the zero-relative 
  181.  index . 
  182. If 
  183.  index 
  184. is negative or out of range, an 
  185.  \f3\f3Error\f1\f1 
  186. exception is raised.
  187. .TP
  188. \f3inline void set (const Type& value\f3);\f1
  189. Sets the value of the data member in the node to
  190.  value .
  191. .TP
  192. \f3inline void set_compare (\f2D_Node_Compare \f3= NULL);\f1
  193. Sets the comparison function that is to be used in all comparison tests. 
  194.  D_Node_Compare 
  195. is a function of type 
  196.  Boolean 
  197. (\f2*Function\f1)(\f3const Type&\f1, \f3const Type&\f1). If no argument is provided, the
  198.   operator== 
  199. for the type over which the 
  200. class is parameterized is used.
  201. .SH COPYRIGHT
  202.  
  203. Copyright (C) 1991 Texas Instruments Incorporated.
  204.  
  205. Permission is granted to any individual or institution to use, copy, modify,
  206. and distribute this software, provided that this complete copyright and
  207. permission notice is maintained, intact, in all copies and supporting
  208. documentation.
  209.  
  210. Texas Instruments Incorporated provides this software "as is" without
  211. express or implied warranty.
  212.  
  213.